home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / earcd / biz / swood / fw_mef_e.lha / FW_MEf-e / ISeveral.fw.long < prev    next >
Text File  |  1997-04-27  |  5KB  |  235 lines

  1. /* ============================================ */
  2. /* Final Writer Arexx Macro - Mehrfach Einfügen */
  3. /* This macro will duplicate any selected       */
  4. /* graphic objects. (group or ungroup)          */
  5. /* by Heiko Schröder (Age Ass)                  */
  6. /* $VER: Insert Several 1.5 (97/04/27)          */
  7. /* DocItemPrefs Abfrage                         */
  8. /* ============================================ */
  9. R='0A'X
  10. Dre=0
  11. Sei=0
  12.  
  13. Address='FinalW'
  14. Options results
  15.  
  16. STATUS PORTNAME
  17. FW = result
  18. address = FW
  19.  
  20. SIGNAL ON BREAK_C
  21. SIGNAL ON SYNTAX
  22.  
  23. 'ShowMessage 2 1 "Insert Several V1.5e - 97/04/27" "© Heiko Schroeder" "E-Mail: age@thepentagon.com" "(-:" "Ok" "(-:"'
  24.  
  25. GetDocItemPrefs Decimal
  26. Punkt=Result
  27. If Punkt="Comma" then DocItemPrefs Decimal Period
  28.  
  29. GraphicTool
  30. nr=1
  31. CurrentObject
  32. ObjectId = Result
  33. IF ObjectId=0 THEN do
  34.    'ShowMessage 1 1 "Macro: Insert Several" "A B O R T" "No graphical object selected..." "Okay" "" ""'
  35.    Call BREAK_C
  36. End
  37.  
  38. /*Kontrolle ob ein oder mehrere Objekte ausgewählt sind*/
  39.  
  40. Objekt.0=nr; Objekt.nr=ObjectID
  41. FirstObject Selected
  42. ID=result
  43. Call Zaehlen
  44. Do While 1
  45.    NextObject ID Selected
  46.    ID=result
  47.    If ID=0 then Leave
  48.    Call Zaehlen
  49. End
  50.  
  51. If Objekt.0=1 then do
  52.    gruppe=false
  53. end
  54. else gruppe=true
  55.  
  56. Do a=2 to Objekt.0
  57.    SelectObject Objekt.a MULTIPLE
  58. End
  59. SelectObject Objekt.1 MULTIPLE
  60. /*Ende der Kontrolle*/
  61.  
  62. STATUS View
  63. Zoom=result
  64.  
  65. STATUS Pages
  66. Seiten=result
  67.  
  68. STATUS Page
  69. Seite=result
  70.  
  71. If Gruppe=true then Group
  72.  
  73. Copy
  74. IF RC=0 THEN do
  75.    CurrentObject
  76.    ObjectID=result
  77.    GetObjectCoords ObjectID
  78.    Parse var result Seite x y w h
  79.    wl=w
  80.    hl=h
  81.    GetObjectRotation ObjectID
  82.    Dreh=result
  83.    GetObjectType ObjectID
  84.    Typ=result
  85.  
  86.    If Typ=2|Typ=3 then do
  87.       If Seite~=1 then do
  88.          'ShowMessage 1 1 "FW has problems with lines outside" "the page 1... CANCEL" "" "Okay" "" ""'
  89.          Call BREAK_C
  90.       End
  91.    End
  92.    If Gruppe=true then Ungroup
  93.  
  94.    'ShowMessage 1 0 "Screen output?" "" "" "normal" "speed" ""'
  95.    ba=result
  96.  
  97.    IF ba=2 THEN DO
  98.       status WINDOW
  99.       parse VAR result links oben width height minwidth minheight maxwidth maxheight
  100.       sizewindow minwidth minheight
  101.    End
  102.  
  103.    Do While 1
  104.       Result="ß"
  105.       RequestText '"Insert Several" "Number of copies" ""'
  106.       Anzahl=Result
  107.       If Anzahl="ß" then call Ende1
  108.       If Anzahl=""|Anzahl=0 then call Ende
  109.       If Datatype(Anzahl,'W')=1 then leave
  110.             else call oops
  111.    End
  112.  
  113.    Do while 1
  114.       Result="ß"
  115.       RequestText '"Insert Several" "Horizontal displacement:" ""'
  116.       Hor=Result
  117.       If Hor="ß" then call Ende1
  118.       If Hor="" then Hor=0
  119.       If Datatype(Hor,'N')=1 then leave
  120.             else call oops1
  121.    End
  122.  
  123.    Do while 1
  124.       Result="ß"
  125.       RequestText '"Insert Several" "Vertical displacement:" ""'
  126.       Ver=Result
  127.       If Ver="ß" then call Ende1
  128.       If Ver="" then Ver=0
  129.       If Datatype(Ver,'N')=1 then leave
  130.             else call oops1
  131.    End
  132.  
  133.    If Typ~=2&Typ~=3 then do                     /*Linien*/
  134.       Do while 1
  135.          Result="ß"
  136.          RequestText '"Insert Several" "Rotation:" ""'
  137.          Dre=Result
  138.          If Dre="ß" then call Ende1
  139.          If Dre="" then Dre=0
  140.          If Datatype(Dre,'W')=1 then leave
  141.             else call oops
  142.       End
  143.  
  144.       Do While 1
  145.          Result="ß"
  146.          RequestText '"Insert Several" "On which page? 0=selected page" ""'
  147.          Sei=Result
  148.          If Sei="ß" then call Ende1
  149.          If Sei=""|Sei=0 then Sei=Seite
  150.          If Datatype(Sei,'W')=1 then leave
  151.             else call oops
  152.       End
  153.    end
  154.  
  155.    s=Sei-Seiten
  156.  
  157.    Do a=1 to s
  158.       InsertPageBreak
  159.    End
  160.       
  161.    If ba=2 then View 20
  162.    Do i=1 TO Anzahl
  163.       Paste
  164.       CurrentObject
  165.       ObjectID=Result
  166.       a=x+(Hor*i)
  167.       b=y+(Ver*i)
  168.       Winkel=Dreh+Dre*i
  169.       If Typ=2|Typ=3 then do                     /*Linien*/
  170.          w=wl+(Hor*i)
  171.          h=hl+(Ver*i)
  172.          Sei=Seite
  173.       End
  174.       SetObjectCoords ObjectID Sei a b w h    /*Probleme bei Linien*/
  175.       SetObjectRotation ObjectID Winkel
  176.       If Gruppe=true then Ungroup
  177.    End
  178. End
  179. Redraw
  180.  
  181. Call WH
  182.  
  183. 'ShowMessage 2 1 "Thanks for using." "" "" "@-`-" "Please" ":-))"'
  184. Exit
  185.  
  186. ENDE:
  187.    Call WH
  188.    'ShowMessage 1 1 "Incorrect number of copies..." "A B O R T" "" "Okay" "" ""'
  189.    EXIT
  190.  
  191. ENDE1:
  192.    Call WH
  193.    'ShowMessage 1 1 "You have cancelled..." "© Heiko Schröder" "http://yi.com/home/SchroederHeiko" "Okay" "" ""'
  194.    EXIT
  195.  
  196. SYNTAX:
  197.    Call WH
  198.    'ShowMessage 1 1 "There was an error." "Error-identification you can find in »Ram:Error«" "" "Okay" "" ""'
  199.    address "REXX"
  200.    Open("F","Ram:Error","W")
  201.    write ("F", "ATTENTION! FW_MEf V1.5e-Error")
  202.    write ("F",'Error in line' SIGL ':' ERRORTEXT(RC))
  203.    write ("F", 'Please report the author. » s93324@fh-telekom-leipzig.de «'||R||R)
  204.    Close ("F")
  205. EXIT
  206.  
  207. BREAK_C:
  208.    Call WH
  209.    'ShowMessage 1 1 "Macro-Break..." "" "" "I know..." "" ""'
  210.    EXIT
  211.  
  212. WH:
  213.    If ba=2 then do
  214.       GoToPage Sei
  215.       View Zoom
  216.       sizewindow width height
  217.    End
  218.    If Punkt="Comma" then DocItemPrefs DECIMAL Comma
  219. Return
  220.  
  221. Zaehlen:
  222. If ID~=Objekt.1 then do
  223.    nr=nr+1
  224.    Objekt.0=nr; Objekt.nr=ID
  225. End
  226. Return
  227.  
  228. oops:
  229. 'ShowMessage 1 1 "Input error!" "" "" "Okay" "" ""'
  230. return
  231.  
  232. oops1:
  233. 'ShowMessage 1 1 "Input error!" "Please use (.) !" "" "Okay" "" ""'
  234. return
  235.